package com.raimcomputing.pickforme.service.utility;

import com.raimcomputing.pickforme.common.vo.UserVo;

/**
 * Handles all code involving generation and validation of passwords as well as seed generation.
 * 
 */
public interface PasswordUtility {

	/**
	 * Takes in a new password and salt and returns the encrypted hash.
	 * 
	 * @param password
	 *            Plaintext password.
	 * @param salt
	 *            Salt.
	 * @return The hashed password.
	 */
	byte[] createNewPassword( String password, String salt );

	/**
	 * Verifies that the encrypted password hash in the UserVo matches the passed in password and
	 * salt from the UserVo.
	 * 
	 * @param user
	 *            UserVo with user information on it.
	 * @param password
	 *            The plaintext password.
	 * @return True if the passphrase matches.
	 */
	boolean verifyPassphrase( UserVo user, String password );

	/**
	 * Generates a random salt.
	 * 
	 * @return The random salt.
	 */
	String generateSalt();
}
